﻿using System.IO;
using EmbeddedSharp.Core;

namespace Zove.Runtime.Core {
    public class ClassContentProvider : ITextContentProvider {

        public ILanguageNature LanguageNature { get; set; }

        public string Name { get; set; }

        public ClassContentProvider(string className, ILanguageNature languageNature) {
            this.Name = className;
            LanguageNature = languageNature;
        }

        public TextReader SourceReader {
            get {
                string location = LanguageNature.ClassFinder.GetLocation(Name);
                return new StreamReader(location);
            }
        }
    }
}
